package com.hmdp.entity;

import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author ZhongTB
 * @create 2023-07-11 9:29
 */
@Data
public class Captcha {

    private String code;
    private LocalDateTime expireTime;

    public Captcha(String code, long expireIn) {
        this.code = code;
        this.expireTime = LocalDateTime.now().plusSeconds(expireIn);
    }

    public boolean isExpired(){
        return LocalDateTime.now().isAfter(expireTime);
    }
}
